home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
parallel
/
pingpong
< prev
next >
Wrap
Text File
|
1992-04-11
|
367b
|
23 lines
ping(0).
ping(Times):-
out(ping),
in(pong),
send_request__(writeln(ping)),
New_times is Times - 1,
ping(New_times).
pong(0).
pong(Times):-
in(ping),
out(pong),
send_request__(writeln(pong)),
New_times is Times - 1,
pong(New_times).
start(Pong_machine,Times):-
eval(Pong_machine,pong(Times),pingpong),
ping(Times).